﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace curriculum_design.Model
{
    public class TestItem
    {
        [Key]
        public int ProjectId { get; set; }//项目id，主键
        [Display(Name = "项目名称")]
        public string? ItemName { get; set; }//项目名称
        [Display(Name = "档位（V/A）")]
        public string? Gear { get; set; }//档位
        [Display(Name = "百分比（%）")]
        public double Percentage { get; set; }//百分比
        [Display(Name = "数据下限（%）")]
        public double LowerLimit { get; set; }//数据下限
        [Display(Name = "数据上限（%）")]
        public double UpperLimit { get; set; }//数据上限
        [Display(Name = "实测数据（%）")]
        public double RealData { get; set; }//实测数据

        //public int Resultid { get; set; }
        //public ResultClass result {  get; set; }

        public int DeviceId { get; set; }//设备id,外键

        // 导航属性，表示与Device实体之间的关系
        [ForeignKey("DeviceId")]
        public Device? Device { get; set; }//一个测试项目对应一个设备实体

        public ResultClass? Result {  get; set; }
    }
}
